//轮播图
import { CAROUSEL, CAROUSELGROUP } from './api';
import { request, METHOD } from '@/utils/request';
//添加轮播图
export async function addCarouselApi(params) {
  return request(CAROUSEL + '/create', METHOD.POST, params);
}
//删除轮播图
export async function delCarouselApi(params) {
  return request(CAROUSEL + '/delete/', METHOD.DELETE, params.id);
}
//更新轮播图
export async function editCarouselApi(params) {
  return request(CAROUSEL + '/update/', METHOD.PUT, params);
}
//获取单个轮播图
export async function getCarouselApi(params) {
  return request(CAROUSEL + '/get', METHOD.GET, params);
}

/*轮播图分组 */

//添加轮播图分组
export async function addCarouselGroupApi(params) {
  return request(CAROUSELGROUP + '/create', METHOD.POST, params);
}
//修改轮播图分组名
export async function editCarouselGroupApi(params) {
  return request(CAROUSELGROUP + '/update/', METHOD.PUT, params);
}
//删除分类
export async function delCarouselGroupApi(params) {
  return request(CAROUSELGROUP + '/delete/', METHOD.DELETE, params.carouselGroupId);
}
//获取所有轮播图分组及对应图片
export async function getAllCarouselGroupListApi(params) {
  return request(CAROUSELGROUP + '/getAllCarouselGroup', METHOD.GET, params);
}
//获取某个轮播图分组及分组下的图片
export async function getCarouselGroupListApi(params) {
  return request(CAROUSELGROUP + '/get', METHOD.GET, params);
}

// export default {
//     addCarouselApi,
//     getCarouselApi,
//     delCarouselApi,
//     addCarouselGroupApi,
//     editCarouselGroupApi,
//     delCarouselGroupApi,
//     getAllCarouselGroupListApi,
//     getCarouselGroupListApi
// };
